import {
     RouteConfig,
} from '@/types/router';
import { DELETE, GET, POST, PUT } from '../index';

/* 领域词库 */
// 词库新增
export const domainThesaurusCreate = (data: any = {}) => {
     return POST<any, RouteConfig>(`/api/v2/serve/lexicon/add`, data)
}
//更新词库
export const domainThesaurusUpdate = (data: any = {}) => {
     return POST<any, RouteConfig>(`/api/v2/serve/lexicon/update`, data)
}
//删除词库
export const domainThesaurusDelete = (data: any = {}) => {
     return POST<any, RouteConfig>(`/api/v2/serve/lexicon/delete`, data)
}
//领域列表
export const domainList = (data: any = {}) => {
     return POST<any, RouteConfig>(`/api/v2/serve/lexicon/query_page?page=` + data.page + '&page_size=' + data.page_size, { keyword: data.keyword })
}

// 领域词库（无分页) --- app绑定
export const lexicon_domain_list = (data: any = {}) => {
     return POST<any, RouteConfig>(`/api/v2/serve/lexicon/list`,data)
}

//查询app有关的领域
export const getLexiconByApp = (data: any = {}) => {
     return POST<any, RouteConfig>(`/api/v2/serve/lexicon/list_by_app_code`,data)
}

//存为案例
export const caseSave = (data: any = {}) => {
     return POST<any, RouteConfig>(`/api/v2/serve/term/case_save`,data)
}

/* 术语同义词等相关 */
//术语新增
export const termCreate = (data: any = {}) => {
     return POST<any, RouteConfig>(`/api/v2/serve/term/add`, data)
}
//术语更新

export const termUpdate = (data: any = {}) => {
     return POST<any, RouteConfig>(`/api/v2/serve/term/update`, data)
}
//术语删除
export const termDelete = (data: any = {}) => {
     return POST<any, RouteConfig>(`/api/v2/serve/term/delete`, data)
}
//术语列表
export const termList = (data: any = {}) => {
     return POST<any, RouteConfig>(`/api/v2/serve/term/query_page_like?page=` + data.page + '&page_size=' + data.page_size, { keyword: data.keyword, type: data.type, lexicon_domain_id: data.lexicon_domain_id })
}
//应用管理
export const applicationList = (data: any = {}) => {
     return POST<any, RouteConfig>(`/api/v1/app/list`, data)
}
//智能生成
export const intelligentGenerationApi = (data: any = {}) => {
     return POST<any,RouteConfig>(`/api/v2/serve/term/intelligent_generation`,data)
}